<!-- eslint-disable max-len -->
<template>
  <div class="taskVerifyDetail h100">
    <!-- 操作栏 -->
    <div class="taskVerifyDetailFooter" style="width:100%;display:flex;">
          <div style="transform:scale(0.9);margin-left:-20px;flex:1">
            <swSteps :audit="BottomType==='pendingReview'" :activeIndex="activeIndex"></swSteps>
          </div>
          <div style="transform:scale(0.9)">
          <div v-if="BottomType==='pendingApplication'" style="float:right;margin-top:30px;">
            <auth-button :auth="todoPerms.apply.urge" style="margin-left: 10px" @click="handleUrge" >
              {{ $t('urge') }}
            </auth-button >
            <auth-button :auth="todoPerms.apply.withdraw" v-if="!hideWithdrawBtn" @click="handleCancel"  style="margin-left: 10px" >
              {{ $t('withdraw') }}
            </auth-button >
          </div>
          <div v-if="BottomType==='passedApplication'" style="float:right;margin-top:30px;">
            <a-button style="margin-left: 10px">
              <span class="titleBold">{{ $t('auditResult')+"：" }}</span>
              <span class="ok titleBold">{{ $t('passed') }}</span>
            </a-button>
            <a-button style="margin-left: 10px">
              <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
              <span class="ok titleBold">{{ endTime }}</span>
            </a-button>
          </div>
          <div v-if="BottomType==='rejectedApplication'">
            <div style="float:right;margin-top:30px;" v-if="!fromApplication">
              <a-button style="margin-left: 10px">
                <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
                <span class="reject titleBold">{{ $t('rejected') }}</span>
              </a-button>
              <a-button style="margin-left: 10px">
                <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
                <span class="ok titleBold">{{ endTime }}</span>
              </a-button>
            </div>
            <div v-else style="display:flex;">
              <div style="display:flex;flex-direction: column">
                <a-button style="margin-bottom: 20px">
                  <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
                  <span class="reject titleBold">{{ $t('rejected') }}</span>
                </a-button>
                <a-button style="">
                  <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
                  <span class="ok titleBold">{{ endTime }}</span>
                </a-button>
              </div>
              <div style="margin-top:50px">
                <auth-button type="primary" style="margin-left: 10px" @click="editFailedForm">
                  {{ $t('reEdit') }}
                </auth-button>
                <auth-button type="danger" :auth="todoPerms.apply.repealInstance" style="margin-left: 10px;" @click="fz">
                  {{ $t('repeal') }}
                </auth-button >
              </div>
            </div>
          </div>
          <div v-if="BottomType==='canceledApplication'">
            <div style="float:right;margin-top:30px;" v-if="!fromApplication">
              <a-button style="margin-left: 10px">
                <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
                <span class="reject titleBold">{{ $t('sqych') }}</span>
              </a-button>
              <a-button style="margin-left: 10px">
                <span class="titleBold ">{{ $t('timeofCancel')+"：" }}</span>
                <span class="ok titleBold">{{ endTime }}</span>
              </a-button>
            </div>
            <div v-else style="display:flex;">
              <div style="display:flex;flex-direction: column">
                <a-button style="margin-bottom: 20px">
                  <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
                  <span class="reject titleBold">{{ $t('sqych') }}</span>
                </a-button>
                <a-button>
                  <span class="titleBold ">{{ $t('timeofCancel')+"：" }}</span>
                  <span class="ok titleBold">{{ endTime }}</span>
                </a-button>
              </div>
              <div style="margin-top:50px">
                <auth-button type="primary" style="margin-left: 10px" @click="editFailedForm" v-if="$route.query.swcode === 'sw_repo_audit'">
                  {{ $t('reEdit') }}
                </auth-button>
                <auth-button type="danger" :auth="todoPerms.apply.repealInstance" style="margin-left: 10px;" @click="fz" v-if="$route.query.swcode === 'sw_repo_audit'">
                  {{ $t('repeal') }}
                </auth-button >
              </div>
            </div>
          </div>
          <div v-if="BottomType==='upShelvesApplication'">
            <div style="display:flex;">
              <div style="display:flex;flex-direction: column">
                <a-button style="margin-bottom: 20px">
                  <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
                  <span class="onshelfed titleBold">{{ $t('onshelfed') }}</span>
                </a-button>
                <a-button style="">
                  <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
                  <span class="ok titleBold">{{ endTime }}</span>
                </a-button>
              </div>
              <div style="margin-top:50px">
                <auth-button :auth="todoPerms.apply.downShelves"  style="margin-left: 10px;"  type="primary" @click="xj">
                  {{ '下架表单' }}
                </auth-button >
                <!-- <auth-button type="danger" :auth="todoPerms.apply.repealInstance" style="margin-left: 10px;" @click="fz">
                  {{ $t('repeal') }}
                </auth-button > -->
              </div>
            </div>
          </div>
          <div v-if="BottomType==='downShelvesApplication'">
            <div style="display:flex;">
              <div style="display:flex;flex-direction: column">
                <a-button style="margin-bottom: 20px">
                  <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
                  <span class="titleBold">{{ $t('offshelfed') }}</span>
                </a-button>
                <a-button style="">
                  <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
                  <span class="ok titleBold">{{ endTime }}</span>
                </a-button>
              </div>
              <div style="margin-top:50px">
                <auth-button :auth="todoPerms.apply.upShelves"  style="margin-left: 10px;"  type="primary" @click="sj">
                  {{ '上架表单' }}
                </auth-button >
                <auth-button type="danger" :auth="todoPerms.apply.repealInstance" style="margin-left: 10px;" @click="fz">
                  {{ $t('repeal') }}
                </auth-button >
              </div>
            </div>
          </div>
          <div v-if="BottomType==='pendingReview'" style="float:right;margin-top:30px;">
            <auth-button :auth="todoPerms.review.pass" type="primary" :disabled="addInfoBtn" style="margin-left: 10px" @click="pass" v-if="$route.query.swcode === 'sw_repo_audit'">
              {{ $t('pass') }}
            </auth-button >
            <auth-button :auth="todoPerms.review.pass" type="primary" style="margin-left: 10px" @click="pass" v-else>
              {{ $t('pass') }}
            </auth-button >
            <auth-button type="danger" :auth="todoPerms.review.reject" @click="reject" style="margin-left: 10px" >
              {{ $t('reject') }}
            </auth-button >
               <!-- 转交 -->
            <auth-button :auth="todoPerms.review.pass" v-if="hideTransfor"  @click="transferReviewInfo" style="margin-left: 10px" >
              {{ $t('transfer') }}
            </auth-button >
            <auth-button :auth="todoPerms.review.pass" v-if="hideAddInfoBtn || showInfo" @click="addReviewInfo" style="margin-left: 10px" >
              {{ $t('addAuditInformation') }}
            </auth-button >
          </div>
            <div v-if="BottomType==='transforReview'" style="float:right">
               <a-button style="margin-left: 10px">
              <span class="titleBold">{{ $t('auditResult')+"：" }}</span>
              <span class="reject titleBold">{{ $t('forwardedTo') }}</span>
            </a-button>
            <a-button style="margin-left: 10px">
              <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
              <span class="ok titleBold">{{ endTime }}</span>
            </a-button>
            </div>
          </div>
    </div>
    <!-- 查看软件管控申请表单 -->
    <div style="background:#ECECEC;padding:0" class="taskVerifyDetailTop" ref="box" @scroll="handleScroll($event)">
      <a-form-model
        class="detailPaddingPage"
        style="display: flex; flex-direction: column"
        :layout="formLayout"
        :model="formData">
        <!-- 基本信息 -->
        <a-card class="card-radius basic-info-style" id="sw-step-1">
          <a-row :gutter="[80,10]">
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('vehicleModel1') }}
                </span>
                <a-input :value="formData.modelCode||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('ecuName') }}
                </span>
                <a-input :value="formData.ecuName||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('partNo') }}
                </span>
                <a-input :value="formData.partNo||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('mainChip') }}
                </span>
                <a-input :value="formData.mainChip||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('isConfigFile') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(formData.isConfigFile,yesOrNoEnumArr)||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('engineerAcademySupervisor') }}
                </span>
                <a-input :value="formData.contactPersonName && formData.contactPersonId?formData.contactPersonName+'-'+formData.contactPersonId:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  {{ $t('vehicleSub') }}
                </span>
                <a-input :value="formData.subType?formData.subType:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  <span v-if="!formData.isConfigFile">{{ $t('softwareCoding') }}</span>
                  <span v-else>{{ $t('configurationFileCode') }}</span>
                </span>
                <a-input :value="formData.softwareCode||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('planningAcademySupervisor') }}
                </span>
                <a-input :value="formData.creatorName && formData.creatorId?formData.creatorName+'-'+formData.creatorId:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]" style="margin-top:30px">
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('hardVersion') }}
                </span>
                <a-input :value="formData.hardVersion?formData.hardVersion:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <div style="display:flex;justify-content: space-between;margin-bottom: -1px;margin-top: -1px;" class="myLabel">
                  <span>
                  <span class="requiredStar">*</span>
                    {{ $t('softVersionName')+" :" }}
                  </span>
                  <question-mark-tip :tip-title="$t('inputVersionNameWithoutVTip')" :popupContainer="getPopupContainer">
                  </question-mark-tip>
                </div>
                <a-input :value="formData.versionNumber||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('sjblx') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(formData.upgradePackType,updateFileTypeEnumArr)" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('hardVersionDate') }}
                </span>
                <a-input :value="formData.hardVersionDate?formData.hardVersionDate:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('softwareDate') }}
                </span>
                <a-input :value="formData.proDate||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('dllFileClassName') }}
                </span>
                <a-input :value="formData.dllName||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('bootVersion') }}
                </span>
                <a-input :value="formData.bootVer" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <div style="display:flex;justify-content: space-between;margin-bottom: -1px;margin-top: -1px;" class="myLabel">
                  <span>
                  <span class="requiredStar">*</span>
                    {{ $t('dependencyVersion')+" :" }}
                  </span>
                  <question-mark-tip :tip-title="$t('dependencyVersionTipOfMC')" :popupContainer="getPopupContainer">
                  </question-mark-tip>
                </div>
                <a-input :value="formData.compatibleVersion?formData.compatibleVersion:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <div style="display:flex;justify-content: space-between;margin-bottom: -1px;margin-top: -1px;" class="myLabel">
                  <span>
                  <span class="requiredStar">*</span>
                    {{ $t('sxType')+" :" }}
                  </span>
                  <question-mark-tip :tip-title="'烧写类型VDS（CAN/CANFD）、VDS（以太网）默认支持OTA升级。'" :popupContainer="getPopupContainer">
                  </question-mark-tip>
                </div>
                <a-input :value="$options.filters.DictLabelFilter(formData.ecuReprogramType,flushTypeEnumArr2)||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('timeoutPeriod') }}
                  </span>
                  <a-input :value="formData.timeout||'-'" readOnly/>
                </a-form-model-item>
                </a-col>
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('suitableVehicleConfig') }}
                  </span>
                  <a-input :value="formData.modelConfigure?formData.modelConfigure:'-'" readOnly/>
                </a-form-model-item>
                </a-col>
              </a-row>
            </a-col>
            <a-col :md="16" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('burnSpecification') }}
                </span>
                <a-textarea :value="formData.criterion" :rows="4" style="resize:none;height:200px" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]" style="margin-top:30px">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('technicalPerformanceChange') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(Number(formData.technicalFeature),yesOrNoEnumArr)||'-'" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      {{ $t('uploadVerificationMaterials') }}
                    </span>
                    <a-card class="card attachment-style" title="附件信息" size="small">
                      <p v-if="!verifyList.length">无</p>
                      <div class="attachmentItem" v-for="(item, index) in verifyList" :key="index" v-else>
                        <a @click="downloadFile(item)">
                          <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                        </a>
                      </div>
                    </a-card>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('isTechnicalParameterChange') }}
                </span>
                <a-input :value="formData.technicalFeature?$options.filters.DictLabelFilter(Number(formData.notice),yesOrNoEnumArr):'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="16" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('technicalParameterChange') }}
                </span>
                <a-textarea :value="formData.technicalParameters||'-'" :rows="4" style="resize:none;height:200px" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]" style="margin-top:30px">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('isOverseasRegulatoryInvolve') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(Number(formData.overLawsChange),yesOrNoEnumArr)||'-'" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('influenceOverseasRegulatoryParams') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(formData.overParameters,yesOrNoEnumArrString)||'-'" readOnly/>
              </a-form-model-item>
              </a-col>
              </a-row>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  {{ $t('uploadOverseasVerificationMaterials') }}
                </span>
                <a-card class="card attachment-style" title="附件信息" size="small">
                  <p v-if="!overSeasList.length">无</p>
                  <div class="attachmentItem" v-for="(item, index) in overSeasList" :key="index" v-else>
                    <a @click="downloadFile(item)">
                      <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                    </a>
                  </div>
                </a-card>
              </a-form-model-item>
            </a-col>
            <!-- <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      {{ $t('formStatus') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter($route.query.status,formsStatusArr)" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col>
              <a-form-model-item>
                <span slot="label">
                  {{ $t('sjzt') }}
                </span>
                <a-input :value="sjzt?$t(sjzt):'-'" readOnly/>
              </a-form-model-item>
              </a-col>
              </a-row>
            </a-col> -->
          </a-row>
        </a-card>
         <!-- 软件用途 -->
        <a-card class="card-radius software-use-style" id="sw-step-2">
          <a-row :gutter="[80,40]">
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('softwareUse') }}
                </span>
              <div style="border:1px solid #ccc;padding:10px 20px;border-radius:10px">
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('供应商选项') }}
                  </span>
                  <a-input :value="softPurposeSupplierName||'-'" readOnly/>
                </a-form-model-item>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('工程师选项') }}
                  </span>
                  <a-input :value="softPurposeName||'-'" readOnly/>
                </a-form-model-item>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('softwareDistributionScope') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.softStageDetailSupplier ,softwareDistributionScopeEnumArr)||'-'" readOnly/>
                </a-form-model-item>
              </div>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('modelDevelopmentStage') }}
                </span>
                <a-input :value="formData.carDevStage||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('userPerception') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(Number(formData.perceptible),userPerceptionEnumArr)||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span v-if="formData.carDevStage=='SOP'" class="requiredStar">*</span>
                  {{ $t('ecnEcrDcnFileDocumentUpload') }}
                </span>
                <a-card class="card attachment-style" title="附件信息" size="small">
                  <p v-if="!ECNList.length">无</p>
                  <div class="attachmentItem" v-for="(item, index) in ECNList" :key="index" v-else>
                    <a @click="downloadFile(item)">
                      <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                    </a>
                  </div>
                </a-card>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,40]">
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('stateSummary') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(formData.stateSum,stateSummaryEnumArr)||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar" v-if="formData.stateSum!=1">*</span>
                  {{ $t('problemSummary') }}
                </span>
                <a-textarea :value="formData.problemsSum?formData.problemsSum:'-'" :rows="4" style="resize:none" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('degreeOfUrgency') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(Number(formData.isEmergency),degreeOfUrgencyEnumArr)||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item v-if="formData.isEmergency">
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('urgentCause') }}
                </span>
                <a-textarea :value="formData.emergencyReason||'-'" :rows="4" style="resize:none" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('isAffectsCertificationOrRegulatory') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(Number(formData.impressApprove),yesOrNoEnumArr)||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item v-if="formData.impressApprove">
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('effectsItemsOrParameters') }}
                </span>
                <a-textarea :value="formData.impressCarType||'-'" :rows="4" style="resize:none" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,40]">
            <a-col>
            <span class="requiredStar">*</span>
            <span class="myLabel">{{ $t('softwareChangeDescription') }}</span>
            <a-form-model-item>
              <a-table
                :scroll="{y:200}"
                :columns="softwareChangeDetailColumns"
                :data-source="formData.changeExplains"
                :rowKey="(record, index) => {return index}"
                :pagination="false"
                style="min-height:200px"
              >
              </a-table>
            </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>
        <!-- 文件信息 -->
        <a-card class="card-radius" id="sw-step-3">
          <div v-if="isUpdateFile">
            <div style="margin-bottom:10px"><span class="requiredStar">*</span><span style="fontWeight:600;">{{ $t('fileInfo') }}</span></div>
            <a-form-model-item>
              <a-table
                :scroll="{y:200}"
                :columns="columns"
                :data-source="formData.upgradePacks"
                :pagination="false"
                style="min-height:200px"
              >
                <template #fileUploadStatusName="text,record">
                  {{ text }}
                  <a-tooltip placement="top" v-if="record.showFaildReason" :getPopupContainer="getPopupContainer">
                    <template slot="title">
                      {{ record.failReason }}
                    </template>
                    <a-icon type="exclamation-circle" :style="{ color: 'red' }"/>
                  </a-tooltip>
                </template>
                <template #primitiveVersion="text">
                  {{ text?text:'无' }}
                </template>
                <template #checksum="text">
                  <a @click="viewCheckSum(text)">{{ $t('view') }}</a>
                </template>
                <template #hashAlgorithm="text">
                  {{ $options.filters.DictLabelFilter(text,digestAlgorithm) }}
                </template>
                <template #fileReprogramType="text">
                  {{ text }}
                </template>
                <template #operation="record">
                  <!-- 升级包类型为2 是差分软件包 -->
                  <span v-if="formData.upgradePackType == 2">
                    <auth-button @click="download(record)" :loading="downloading" :disabled="!canDiffPackageDownload">{{ $t('download') }}</auth-button>
                  </span>
                  <span v-else>-</span>
                </template>
              </a-table>
            </a-form-model-item>
          </div>
          <div v-else>
            <div style="margin-bottom:10px"><span class="requiredStar">*</span><span style="fontWeight:600;">{{ $t('fileInfo') }}</span></div>
            <div style="border:1px solid #ccc;padding:10px 20px;border-radius:10px">
              <a-row :gutter="[80,10]">
                <a-col :md="8" :sm="24">
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('zysf') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(formData.upgradePacks[0].hashAlgorithm,digestAlgorithm)||'-'" readOnly/>
                  </a-form-model-item>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('estimatedInstallTime') }}
                    </span>
                    <a-input :value="formData.upgradePacks[0].installSec?formData.upgradePacks[0].installSec+' s':'-'" readOnly/>
                  </a-form-model-item>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('file')+$t('sxType') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(formData.upgradePacks[0].fileReprogramType,fileFlushTypeEnumArr)||'-'" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col :md="8" :sm="24">
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('zyz') }}
                    </span>
                    <a-input :value="formData.upgradePacks[0].checksum||'-'" readOnly/>
                  </a-form-model-item>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('configFile') }}
                    </span>
                    <a-card class="card attachment-style" title="文件信息" size="small" style="height:100px">
                      <!-- <a class="attachmentItem" @click="downloadConfigFile"> -->
                      <a class="attachmentItem">
                        <table-ellipsis :title="formData.upgradePacks[0].fileName" :text="formData.upgradePacks[0].fileName" :tableEllipsisIsTurnLine="false"/>
                      </a>
                    </a-card>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <!-- 主程序信息 -->
            <div style="margin-top:40px;margin-bottom:10px"><span class="requiredStar">*</span><span style="fontWeight:600;">{{ $t('zcxxx') }}</span></div>
            <a-form-model-item>
              <a-table
                :scroll="{y:200}"
                :columns="mainProgramTbColumns"
                :data-source="dataFormTb"
                :pagination="false"
                style="min-height:200px"
              >
                <template slot="createTime" slot-scope="text">
                  <table-ellipsis
                    :tableEllipsisIsTurnLine="false"
                    :text="text ? $options.filters.moment(text) : '_'">
                  </table-ellipsis>
                </template>
                <template #operation="text">
                  <span class="set-margin">
                    <a-icon type="edit" />
                    <a @click="clickRowOperation('edit',text)">{{ $t('edit') }}</a>
                  </span>
                  <span>
                    <i class="iconfont icon-shanchu deleteUlr"> </i>
                    <a @click="clickRowOperation('delete',text)">{{ $t('delete') }}</a>
                  </span>
                </template>
              </a-table>
            </a-form-model-item>
          </div>
        </a-card>
        <!-- 测试信息 -->
        <a-card class="card-radius" id="sw-step-4">
          <a-form-model-item >
            <table class="testInfo" cellspacing="0" cellpadding="0">
              <!-- 软件开发匹配测试计划 -->
              <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('softwareMatchesPlans')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in testPlanList" :key="index">
                     <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
              <!-- 软件需求分析说明书 -->
              <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('softwareRequirementsAnalysis')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in demandList" :key="index">
                     <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 静态测试报告 -->
              <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('staticTestReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in staticList" :key="index">
                    <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 单元测试报告 -->
               <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('unitTestReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in unitTestList" :key="index">
                    <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 集成测试报告 -->
               <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('integrationTestReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in integrationList" :key="index">
                    <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 黑盒测试与匹配报告 -->
               <tr>
                <td class="td1">
                  <span class="requiredStar">*</span>
                  {{ $t('blackBoxMatchReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in blackTestList" :key="index">
                    <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 软件释放单 -->
               <tr>
                <td class="td1">
                  <span class="requiredStar">*</span>
                  {{ $t('softwareReleaseSheet')+'：' }}
                </td>
                <td class="td2">
                 <span class="mr8 info-style" v-for="(item, index) in releaseList" :key="index">
                    <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
            </table>
          </a-form-model-item>
          <a-row :gutter="80" class=" software-use-style" style="margin-top:20px">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('testConclusion') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.engTestVerdict,passOrNot)||'-'" readOnly/>
                </a-form-model-item>
                </a-col>
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('internalControl') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.controlled,yesOrNoEnumArr)||'-'" readOnly/>
                </a-form-model-item>
                </a-col>
              </a-row>
            </a-col>
            <a-col :md="16" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('testSummary') }}
                </span>
                <a-textarea :value="formData.engTestSummary||'-'" :rows="4" style="resize:none;height:200px" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>
        <!-- 发布说明 -->
        <a-card class="card-radius" id="sw-step-5">
          <div>
            <a-form-model-item :label="$t('versionDescription')" :rules="{required:true}">
              <a-textarea v-model="formData.versionDesc" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
            <a-form-model-item :label="$t('funcAdd')" :rules="{required:true}">
              <a-textarea v-model="formData.funcFeature" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
            <a-form-model-item :label="$t('funcOptimize')" :rules="{required:true}">
              <a-textarea v-model="formData.funcOptimize" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
            <a-form-model-item :label="$t('specialThanks')">
              <a-textarea :value="formData.specialThanks||'-'" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
          </div>
        </a-card>
        <!-- 申请人信息 -->
        <a-card class="card-radius apply-card" id="sw-step-6">
          <a-form-model-item>
            <a-row :gutter="80">
              <a-col :md="8" :sm="24">
                <a-form-model-item label="申请人姓名">
                  <a-input :value="formData.applyUserName.substring(0,formData.applyUserName.indexOf('('))||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="工号">
                  <a-input :value="formData.applyUserId||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="邮箱">
                  <a-input :value="formData.applyUserEmail||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="所属组织架构">
                  <a-input :value="formData.applyUserOrgName||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="电话">
                  <a-input :value="formData.applyPhone||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="申请日期">
                  <a-input :value="formData.applyTime||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-form-model-item>
          <!-- 审核流程 -->
          <review-process
            style="padding:0;height:300px"
            :applyUserName="formData.applyUserName"
            :createTime="formData.createTime"
            :showProcessViewer="false"
            @transTime="handleEndTime"
            @transFileLimit="handleFileLimit"
            @showInfo="handlerShowInfoBtn"
            @hideAddInfoBtn="handleAddInfodrawBtn"
            @addInfoBtn="addInfodrawBtn"
            @hideWithdrawBtn="handleHideWithdrawBtn"
            @hideWithTransforBtn="handleHideWithTransforBtn"
            @checkStatus="hancleStatusCheck"
            />
        </a-card>
        <!-- 审核意见 -->
        <a-card class="card-radius software-use-style" v-if="BottomType==='pendingReview'" id="sw-step-7">
          <!-- v-if="BottomType==='pendingReview'" -->
          <span class="requiredStar">*</span>
          <span class="myLabel">{{ $t('审核意见') }}</span>
          <div style="border:1px solid #ccc;padding:20px 20px 10px;border-radius:10px;">
          <a-row :gutter="40">
            <a-col :md="16" :sm="24">
              <a-tabs default-active-key="1" @change="changeTabs" :size="'small'">
                <a-tab-pane key="1" tab="自定义输入">
                  <a-textarea v-model="formData.taskComment" :max-length="200" style="resize:none;height:180px;width:99%" placeholder="请输入审核意见"/>
                </a-tab-pane>
                <a-tab-pane key="2" tab="常用语选择">
                  <div style="height:180px;overflow-y: auto;overflow-x: hidden;">
                    <a-select placeholder="请选择审核常用语句"
                    :dropdownMenuStyle="{maxHeight:'110px'}"
                    v-model="formData.taskComment" class="select-style">
                      <a-select-option v-for="(item,index) in wordsArr" :key="index" :value="item" :title="item">
                        {{ item }}
                      </a-select-option>
                    </a-select>
                  </div>
                </a-tab-pane>
              </a-tabs>
            </a-col>
            <a-col :md="8" :sm="24">
              <div class="myLabel" style="margin-bottom:10px">{{ $t('上传附件文件') }}</div>
              <a-card class="card uploadAttachment-style" title="附件信息" size="small">
                <template #extra>
                  <a-upload :showUploadList="false"  :multiple="true"  :file-list="auditList" :before-upload="beforeUpload" :customRequest="doUpload">
                    <a-button :loading="uploading" style="border:1px solid #147092;color:#147092"><a-icon type="plus-circle" theme="filled" v-if="!uploading" />
                    {{ $t('uploadAttachment') }}
                    </a-button>
                  </a-upload>
                </template>
                <div class="attachmentItem" v-for="(item, index) in auditInfoList" :key="index">
                  <a class="fileName">
                    <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                  </a>
                  <a @click="removeItem(item.fileId,index)" style="color:red">删除</a>
                </div>
              </a-card>
            </a-col>
          </a-row>
              </div>
        </a-card>
        <!-- 查看摘要值 -->
        <a-modal v-model="showCheckSum" :title="$t('zyz')">
          <template slot="footer">
            <a-button key="back" @click="showCheckSum=false">
              {{ $t('back') }}
            </a-button>
          </template>
          <p>{{ checkSumToModal }}</p>
        </a-modal>
      </a-form-model>
    </div>
  </div>
</template>
<script>
import {downloadBlobFile} from "@/utils/functions";
import swSteps from '@/views/components/step/swSteps.vue'
import { todoPerms } from '@/config/permission/index'
import ReviewProcess from '@/views/todo/myApplication/components/ReviewProcessCompt'
import AuthButton from '@/components/AuthButton'
import { writeFileStream } from '@/utils/functions'
import { DOWNLOAD_FILE_WITH_ID } from '@/config/fetchURL'
import QuestionMarkTip from '@/views/components/QuestionMarkTip'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
import {axios} from '@/utils/request'
import i18n from '@/lang'
import fileUploadApi from '@/api/modules/system/fileUpload'
import SparkMD5 from 'spark-md5'
import { minxinScrollTop } from '@/utils/mixin.js'
// eslint-disable-next-line max-len
import { uploadedFileTableColumnsNoActDraft, yesOrNoEnumArr,yesOrNoEnumArrString,passOrNot, formsStatusArr,attachmentColumns,softwareChangeDetailColumns,degreeOfUrgencyEnumArr, userPerceptionEnumArr, flushTypeEnumArr, stateSummaryEnumArr,updateFileTypeEnumArr, mainProgramTbColumns, softwareDistributionScopeEnumArr} from '@/views/control/softwareManageAndControl/config/list'
export default {
  // mixins:[minxinScrollTop],
  components: {
    AuthButton,
    TableEllipsis,
    QuestionMarkTip,
    ReviewProcess,
    swSteps
  },
  props:{
    addInfoBtn:{
      type:Boolean,
      default:false
    },
    BottomType:{
      type:String,
      default:''
    },
    showInfo:{
      type:Boolean,
      default:false
    }
  },
  data () {
    return {
      activeIndex: 0,
      activities: [
        {id: 'sw-step-1'},
        {id: 'sw-step-2'},
        {id: 'sw-step-3'},
        {id: 'sw-step-4'},
        {id: 'sw-step-5'},
        {id: 'sw-step-6'},
        {id: 'sw-step-7'},
      ],
      scrollHeight: [],
      todoPerms,
      wordsArr: [i18n.t('zxbty'), i18n.t('tyqjkcl'), i18n.t('tyqjscl'), i18n.t('tyqzhptgz'), i18n.t('bypzqhshzsq'), i18n.t('xgclbwz'), i18n.t('sqrqxbfh'), i18n.t('xqbmq')],
      endTime: '',
      fileLimitObj: {
        fileCount: 1,
        fileSize: 1
      },
      // addInfoBtn:false,
      hideWithdrawBtn:false,
      hideTransfor:false,
      auditList:[],
      // 上传附件
      auditInfoList:[],
      uploading: false,
      hideAddInfoBtn:false,
      showAction: false,
      formLayout: 'horizontal',
      showEdit: false,
      dataFormTb: [],
      ECNList:[],
      verifyList:[],
      overSeasList:[],
      testPlanList:[],
      demandList:[],
      staticList:[],
      unitTestList:[],
      integrationList:[],
      blackTestList:[],
      releaseList:[],
      formData: {
        applyTime: '',
        applyUserOrgName: '',
        applyUserName: '',
        applyUserEmail: '',
        isConfigFile: 0,
        softwareCode: '',
        compatibleVersion: undefined,
        modelCode: '',
        modelName: '',
        versionNumber: '',
        candidates: [],
        upgradePacks: [],
        upgradePackType: '',
        ecuReprogramType: '',
        fileIds:	[],
        taskId: '',
        taskComment: ''
      },
      selectedRowKeys: [],
      auditLists: [],
      finishedInfo: {
        finishedSequenceFlowSet: [],
        finishedTaskSet: [],
        unfinishedTaskSet: [],
        rejectedTaskSet: []
      },
      processView: {
        index: '12s',
        xmlData: ''
      },
      columns: uploadedFileTableColumnsNoActDraft,
      showEcuTable: true,
      yesOrNoEnumArr,
      yesOrNoEnumArrString,
      passOrNot,
      formsStatusArr,
      stateSummaryEnumArr,
      degreeOfUrgencyEnumArr,
      userPerceptionEnumArr,
      attachmentColumns,
      softwareChangeDetailColumns,
      softwareDistributionScopeEnumArr,
      isSearch: false,
      ecuOptionArr: [],
      isUpdateFile: true,
      flushTypeEnumArr,
      updateFileTypeEnumArr,
      filterEcuList: [],
      flushTypeEnumArr2: [],
      mainProgramTbColumns,
      disableFlushBtn: true,
      verisonList: [],
      carModelArr: [],
      checkSumToModal: '',
      showCheckSum: false,
      digestAlgorithm: [{ value: 1, name: 'MD5' }, { value: 2, name: 'SHA256' }],
      fileFlushTypeEnumArr: [],
      unStartedAudit: true,
      softPurposeSupplierName:'',
      softPurposeName:'',
      fromApplication:false,
      downloading:false,
      canDiffPackageDownload:false
    }
  },
  created () {
    // 判断是否从我的申请跳转过来
    if(this.$route.query.aorr === 'a'){
      this.fromApplication = true
    }
    // 转译烧写类型
    this.$api.searchFlushTypeRelated(3).then(res => {
      this.flushTypeEnumArr2 = res.data.map((item) => {
        return {
          value: item.code,
          name: item.name
        }
      })
    })
    // t 表示软件管控的表单来源，1代表新建表单，2代表查看表单，3代表编辑表单草稿，4代表查看表单草稿
    // if (this.$route.query.t === '2') {
    this.$api.queryFormDetail(this.$route.query.key).then(res => {
      this.formData = res.data
      this.formData.upgradePacks.map((item,index) =>{
        item = this.fileStatusFaildShow(item)
      })
      this.verifyList=res.data.files.filter(item=>item.bizName=='vds_verify')
      this.overSeasList=res.data.files.filter(item=>item.bizName=='vds_over_verify')
      this.ECNList=res.data.files.filter(item=>item.bizName=='vds_ecn_ecr')
      this.testPlanList= res.data.files.filter(item=>item.bizName=='vds_plan')
      this.demandList= res.data.files.filter(item=>item.bizName=='vds_demand')
      this.staticList= res.data.files.filter(item=>item.bizName=='vds_white_report')
      this.unitTestList= res.data.files.filter(item=>item.bizName=='vds_util')
      this.integrationList= res.data.files.filter(item=>item.bizName=='vds_integration')
      this.blackTestList= res.data.files.filter(item=>item.bizName=='vds_report')
      this.releaseList= res.data.files.filter(item=>item.bizName=='vds_release')
      if (res.data.isConfigFile === 1) {
        this.isUpdateFile = false
        this.dataFormTb = res.data.nonConfigFileApplys
      }
      this.formData.taskId=this.$route.query.p
      this.formData.fileIds=[],
       this.getSoftwareUse()
       this.getSoftUseEngineer()
    })
    // 获取文件烧写类型的下拉，以便进行转译反显
    this.$api.searchFlushType().then(res => {
      this.fileFlushTypeEnumArr = res.data.map((item) => {
        return { value: item.code, name: item.name }
      })
    })
  },
  mounted(){
    this.$nextTick(() => {
      this.getScrollHeight()
    })
    this.checkDownLoad()
  },
  watch:{
    // 'formData.isConfigFile':{
    //   handler(){
    //     this.$nextTick(() => {
    //       this.getScrollHeight()
    //     })
    //   }
    // },
    formData:{
      deep: true,
      handler(){
        this.$nextTick(() => {
          this.getScrollHeight()
        })
      }
    },
  },
  methods: {
    // 校验差分软件包是否可以下载
    checkDownLoad(){
      this.$api.checkDiffPackageDownload(this.$route.query.key).then(res=>{
        this.canDiffPackageDownload=res.data
      })
    },
    // 下载差分包
    download (resource) {
      if (this.downloading) {
        return;
      }
      this.downloading=true;
      this.axios({
        url: '/file-service/file/download/resource',
        method: 'post',
        data:{
          softFormNo:this.formData.applyNumber,
          sourceVersion:resource.primitiveVersion
        },
        responseType: 'blob'
      }).then((res) => {
        downloadBlobFile(res, resource.fileName)
      }).finally(() => {
        this.downloading = false;
      })
    },
    // 编辑文件加工失败的表单
    editFailedForm (data) {
      this.$store.dispatch('tagsView/delView', this.$route.fullPath).then(() => {
        this.$router.replace({ path: '/mc/editAgain', query: { 
          originalId: this.$route.query.key,
          t: 5, 
          id: this.$route.query.id,
          swcode: this.$route.query.swcode,
          aorr: 'a',
          status: this.$route.query.status
        }})
      })
    },
       // 上架表单
    sj (data) {
      const that = this
      const h = this.$createElement
      this.$confirm({
        title: that.$t('onshelfTip'),
        content: h('div', [h('b',that.$t('onshelfContent') ), h('p', that.$t('onshelfContent2'))]),
        onOk () {
          that.$api.listingForm({ id: that.$route.query.key }).then(
            () => {
              that.$store.dispatch('tagsView/delView', that.$route.fullPath).then(() => {
                that.$router.replace({ path: '/todo/myApplication' })
              })
            }
          )
        },
        onCancel () { }
      })
    },
     // 下架表单
    xj () {
      const that = this
      const h = this.$createElement
      this.$confirm({
        title: that.$t('offshelfTip'),
        content: h('div', [h('b',that.$t('offshelfContent') ), h('p', that.$t('offshelfContent2'))]),
        onOk () {
          that.$api.offshelfForm({ id: that.$route.query.key }).then(
            () => {
             that.$store.dispatch('tagsView/delView', that.$route.fullPath).then(() => {
                that.$router.replace({ path: '/todo/myApplication' })
              })
            }
          )
        },
        onCancel () { }
      })
    },
    // 废止
    fz(){
      const that = this
      const h = this.$createElement
      this.$confirm({
        title: that.$t('repealTip'),
        content: h('div', [h('b',that.$t('repealContent') ), h('p', that.$t('repealContent2'))]),
        onOk () {
          that.$api.repealForm({ instanceId: that.$route.query.id }).then(
            () => {
              that.$store.dispatch('tagsView/delView', that.$route.fullPath).then(() => {
                that.$router.replace({ path: '/todo/myApplication' })
              })
            }
          )
        },
        onCancel () { }
      })
    },
    fileStatusFaildShow(item){
      item.showFaildReason = false
      // 加密失败，并且有结果
      if(item.resourceState == 3 && item.failReason){
         item.showFaildReason = true
      }
      return item
    },
    handleScroll(e){
      const sHeight=e.target.clientHeight + e.target.scrollTop
      if((Math.round(sHeight) === e.target.scrollHeight) || 
      (Math.round(sHeight)+1 === e.target.scrollHeight) ||
      (Math.round(sHeight)-1 === e.target.scrollHeight) ){
        this.activeIndex = this.scrollHeight.length -1
      }
      else if(e.target.scrollTop > this.scrollHeight[this.scrollHeight.length-1]-100){
          this.activeIndex = this.scrollHeight.length -1
      }else{
        this.scrollHeight.map((item,index)=>{
          if(e.target.scrollTop >= item){
            this.activeIndex = index;
          }
        })
      }
      // console.log('@@@@@@',e.target.scrollTop)
      // console.log('AAAAAAA',this.activeIndex)
    },
    getScrollHeight() {
      this.scrollHeight = []
      this.activities.map(item => {
          this.scrollHeight.push(document.getElementById(item.id).offsetTop - 15)
      })
      // console.log('@@@@@@@@',this.scrollHeight)
    },
    removeItem(id,index){
      this.auditInfoList=this.auditInfoList.filter(item=>{
        return item.fileId != id
      })
      this.auditList.splice(index,1)
      this.formData.fileIds.splice(index,1)
    },
    // 检测文件大小以内
    beforeUpload(file,auditList){
      // 检测文件大小50M以内
      const maxSize = 1024 * 1024 *this.fileLimitObj.fileSize
      if (file.size > maxSize) {
        const msg = this.$t('uploadLimit').replace('__SIZE__', this.fileLimitObj.fileSize+'M')
        this.$message.error(msg)
        return false
      }
      if(this.fileLimitObj.fileCount&&this.auditList.length>=this.fileLimitObj.fileCount){
          this.$message.error("该审核流程最多上传"+this.fileLimitObj.fileCount+"个文件")
          return false
      }
      return true
    },
    // 自定义上传
    doUpload (options) {
       const vm = this
      vm.$confirm({
        title: vm.$t('systemTip'),
        content:vm.$t('confirmDecrypted'),
        class: 'confirmStyle',
        icon: '<Icon >',
        width: 378,
      onOk() {
        vm.uploading = true
        vm.getChecksum(options.file).then(result => {
        const formData = new FormData()
        formData.append('file', options.file)
        fileUploadApi.uploadWholeFileToLocal(formData, { hashAlgorithm: 1, checksum: result, uploadType: 1 })
          .then(res => {
            let newFileInfo={
              fileId: res.data,
              fileName:options.file.name
            }
            vm.formData.fileIds.push(res.data * 1)
            vm.$message.success(vm.$t('uploadedSuccessfully'))
            vm.auditInfoList.push(newFileInfo)
            vm.auditList.push(options.file)
          }).finally(() => {
            vm.uploading = false
          })
      }).catch(err => {
        console.log(err)
      })},
      onCancel() {},
      })
    },
    // 获取上传文件内容md5
    getChecksum (file) {
      return new Promise((resolve, reject) => {
        const blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice
        const spark = new SparkMD5.ArrayBuffer()
        const fileReader = new FileReader()
        fileReader.readAsArrayBuffer(blobSlice.call(file, 0, file.size))
        fileReader.onload = function (e) {
          spark.append(e.target.result)
          resolve(spark.end())
        }
        fileReader.onerror = function (err) {
          reject(err)
        }
      })
    },
    addReviewInfo(){
      this.$emit('addReviewInfo')
    },
    transferReviewInfo(){
      this.$emit('transferReviewInfo')
    },
    reject(){
      this.$emit('reject')
    },
    pass(){
      this.$emit('pass')
    },
    handleUrge(){
      this.$emit('handleUrge')
    },
    handleCancel(){
      this.$emit('handleCancel')
    },
    // 切换tab
    changeTabs(){
      this.$set(this.formData,'taskComment',undefined)
    },
    // 二次确认审核状态是否变化(从邮件过来，流程或签，审核状态可能已经变化)
    hancleStatusCheck (data) {
      if (this.$route.query.status) {
        if (this.$route.query.status * 1 !== data) {
          const query = { ...this.$route.query }
          query.status = data
          this.$router.replace({ path: this.$route.path, query })
        }
      }
    },
    addInfodrawBtn (bool) {
      this.$emit('addInfodrawBtn',bool)
      // this.addInfoBtn = bool
    },
    // 控制添加补充信息按钮是否显示
    handleAddInfodrawBtn (bool) {
      this.hideAddInfoBtn = bool
    },
    // 完成时间
    handleEndTime (data) {
      this.endTime = this.$options.filters.moment(data)
    },
    // 后端控制上传文件的限制
    handleFileLimit (data) {
      this.fileLimitObj = data
    },
    handlerShowInfoBtn(bool){
      this.showInfo=bool
    },
    // 控制撤回按钮是否显示
    handleHideWithdrawBtn (bool) {
      this.hideWithdrawBtn = bool
    },
    // 控制撤回按钮是否显示
    handleHideWithTransforBtn (bool) {
      this.hideTransfor = bool
    },
     // 获取软件用途
    getSoftwareUse(){
      let dictCode='sw_repo_soft_usage'
      axios({
        url: '/sw-repository/apply/drop-down-box/'+dictCode,
        method: 'get'
      }).then(res => {
          let softwareUseEnumArr = res.data
          let parseName = []
          softwareUseEnumArr.filter((item) => {
            if (item.code == this.formData.softPurposeSupplier) {
                parseName.push(item.name)
            }
          })
          this.softPurposeSupplierName=parseName.toString()
      })
    },
     // 获取软件用途(工程师)
    getSoftUseEngineer(){
      let dictCode='sw_repo_soft_usage_engineer'
      axios({
        url: '/sw-repository/apply/drop-down-box/'+dictCode,
        method: 'get'
      }).then(res => {
          let softUseEngineer = res.data
          let parseName = []
          softUseEngineer.filter((item) => {
            if (item.code == this.formData.softPurpose) {
                parseName.push(item.name)
            }
          })
           this.softPurposeName=parseName.toString()
      })
    },
    // tooltip悬浮
    getPopupContainer () {
      return document.querySelector('.ant-modal-wrap') || document.body
    },
    // 查看摘要值
    viewCheckSum (data) {
      this.checkSumToModal = data
      this.showCheckSum = true
    },
    // 下载上传成功且处理成功的文件
    downloadFile (data) {
      writeFileStream(DOWNLOAD_FILE_WITH_ID + data.fileId, data.fileName)
    },
    // 下载配置文件
    downloadConfigFile () {
      // eslint-disable-next-line max-len
      writeFileStream(DOWNLOAD_FILE_WITH_ID + this.formData.upgradePacks[0].fileId, this.formData.upgradePacks[0].fileName)
    }
  }
}
</script>
<style lang="less" scoped>
.navigator{
  padding: 15px 24px;
  flex: none;
  border-bottom: 1px solid @borderColor;
}
.card-radius{
  border-radius: 10px;
  padding: 30px 80px 30px 46px;
}
::v-deep .ant-card-body {
  padding: 0;
}
.taskVerifyDetail {
  display: flex;
  flex-direction: column;
  .taskVerifyDetailTop {
    position: relative;
    flex: 1;
    overflow: auto;
    min-width: 800px;
  }
  .taskVerifyDetailFooter {
    font-size: 18px;
    padding: 15px 24px;
    flex: none;
    // text-align: center;
    border-bottom: 1px solid @borderColor;
    .ok {
      color: #147092 ;
      font-weight: bold;
    }
    .reject {
      color: #FF0000 ;
      font-weight: bold;
    }
    .onshelfed {
      color: #46d5a2;
      font-weight: bold;
    }
    .titleBold{
      font-weight: 600;
    }
  }
}
.mr8{
  margin-right:8px
}
.attachment-style{
  border:1px solid #ccc;
  border-radius: 10px;
  height: 200px;
  ::v-deep .ant-card-head{
    background: #B8BACF;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }
  ::v-deep .ant-card-body{
    overflow: auto;
    padding: 10px;
    height: 150px;
  }
  .attachmentItem{
    height:40px;
    line-height: 40px;
    border-bottom: 1px solid #F5F5F5;
  }
}
.uploadAttachment-style{
  border:1px solid #ccc;
  border-radius: 10px;
  height: 200px;
  ::v-deep .ant-card-head{
    background: #B8BACF;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }
  ::v-deep .ant-card-body{
    padding: 10px;
    overflow: auto;
    height: 150px;
  }
  .attachmentItem{
    display: flex;
    justify-content: space-between;
    height:40px;
    line-height: 40px;
    border-bottom: 1px solid #F5F5F5;
    .fileName{
      width:70%;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }
  }
}
.testInfo{
  width:100%;
  border-collapse: separate;
  border-spacing: 1px;
  border-top: 1px solid #ccc !important;
  border-left: 1px solid #ccc !important;
  td,tr{
   border-right: 1px solid #ccc !important;
  border-bottom: 1px solid #ccc !important;
  }
  .td1{
    font-weight: 600;
    width:200px;
    text-align: right;
  };
  .td2{
    width:calc(94% - 200px);
    color:blue;
    .info-style{
      border:1px solid rgba(20, 112, 146, 100);
      padding: 5px 8px;
      border-radius: 30px;
      margin: 0 5px;
    }
  };
}
::v-deep .deepClass{
    font-weight: 400;
    margin-right: 38px;
    text-align: right;
}
::v-deep .ant-card-bordered{
  margin-bottom: 12px;
}
.detailPaddingPage{
  padding: 12px;
  }
.marginProcess{
  margin-left: 4%;
  margin-right: 4%;
  }
::v-deep .ant-input[disabled] {
    color: #000;
    background-color: #f5f5f5;
    cursor: default;
    opacity: 1;
}
.set-margin {
  margin-right: 12px;
}
</style>

<style lang="less" scoped>
::v-deep .ant-form-item{
  margin-bottom: 8px ;
}
.basic-info-style,.software-use-style{
  ::v-deep .ant-form-item{
    margin-bottom: 8px ;
  }
  ::v-deep .ant-form-item-control{
    line-height: 20px;
  }
}
.myLabel{
  font-weight: 600;
}
::v-deep .deepClass{
    font-weight: 600;
    margin-right: 38px;
    text-align: right;

}
::v-deep .ant-form-item-label {
    font-weight: 600;
    line-height: 16px;
    // margin-right: 12px;
}
  .customFormModelItem2 {
      ::v-deep .ant-form-item-label {
        &::before {
          display: inline-block;
          content: '';
          width: 6px;
          background-color: rgba(67, 136, 166, 1);
          height: 14px;
          vertical-align: middle;
          margin-right: 3px;
        }
      }
    }

::v-deep .ant-input{
    background-color: rgba(255,255,255,100);
    color: rgba(16,16,16,100);
    font-size: 14px;
    outline: none;
    border: 1px solid rgba(187,187,187,100);
    border-radius: 8px;
  }
::v-deep .ant-input:focus {
  outline: none;
  box-shadow: none;
}
.apply-card{
::v-deep .ant-input{
    border-radius: 8px;
    text-align: center;
  }
}
::v-deep .ant-table-thead > tr >th{
  background: #B8BACF !important;
} 
.select-style{
  ::v-deep .ant-select-selection{   
		background-color: #E6F7FF;
    color:#1684FC;
    height: 60px;
    line-height: 60px;
	}
  ::v-deep .ant-select-selection__rendered {
    line-height: 60px;
  }
}
</style>
